{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第三周作业 在Rental Listing Inquiries数据上练习xgboost参数调优\n",
    "数据说明： Rental Listing Inquiries数据集是Kaggle平台上的一个分类竞赛任务，需要根据公寓的特征来预测其受欢迎程度（用户感兴趣程度分为高、中、低三类）。其中房屋的特征x共有14维，响应值y为用户对该公寓的感兴趣程度。评价标准为logloss。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "调整树深度和子节点权重参数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入必要的包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "from xgboost import XGBClassifier\n",
    "import xgboost as xgb\n",
    "\n",
    "get_ipython().magic('matplotlib inline')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "读取经过特征工程处理好的训练和测试CSV文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dpath = \"./data/\"\n",
    "train = pd.read_csv(dpath + \"RentListingInquries_FE_train.csv\")\n",
    "test = pd.read_csv(dpath + \"RentListingInquries_FE_test.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "y_train = train['interest_level']\n",
    "train = train.drop(['interest_level'], axis=1)\n",
    "x_train = np.array(train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.metrics import log_loss\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "kfold = StratifiedKFold(n_splits=2, shuffle=True, random_state=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "设置好要训练的参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "max_depth = [3,4]\n",
    "min_child_weight = [1,2]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'max_depth': [3, 4], 'min_child_weight': [1, 2]}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "param_test2_1 = dict(max_depth=max_depth, min_child_weight=min_child_weight)\n",
    "param_test2_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "xgb2_1 = XGBClassifier(\n",
    "        learning_rate =0.1,\n",
    "        n_estimators=381,\n",
    "        max_depth=3,\n",
    "        min_child_weight=1,\n",
    "        gamma=0,\n",
    "        subsample=0.3,\n",
    "        colsample_bytree=0.8,\n",
    "        colsample_bylevel = 0.7,\n",
    "        objective= 'multi:softprob',\n",
    "        seed=3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=StratifiedKFold(n_splits=2, random_state=2, shuffle=True),\n",
       "       error_score='raise',\n",
       "       estimator=XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=0.7,\n",
       "       colsample_bytree=0.8, gamma=0, learning_rate=0.1, max_delta_step=0,\n",
       "       max_depth=3, min_child_weight=1, missing=None, n_estimators=381,\n",
       "       n_jobs=1, nthread=None, objective='multi:softprob', random_state=0,\n",
       "       reg_alpha=0, reg_lambda=1, scale_pos_weight=1, seed=3, silent=True,\n",
       "       subsample=0.3),\n",
       "       fit_params=None, iid=True, n_jobs=-1,\n",
       "       param_grid={'max_depth': [3, 4], 'min_child_weight': [1, 2]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gsearch2_1 = GridSearchCV(xgb2_1, param_grid = param_test2_1, scoring='neg_log_loss',n_jobs=-1, cv=kfold)\n",
    "gsearch2_1.fit(x_train , y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "得出训练结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\model_selection\\_search.py:761: DeprecationWarning: The grid_scores_ attribute was deprecated in version 0.18 in favor of the more elaborate cv_results_ attribute. The grid_scores_ attribute will not be available from 0.20\n",
      "  DeprecationWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "([mean: -0.59951, std: 0.00018, params: {'max_depth': 3, 'min_child_weight': 1},\n",
       "  mean: -0.59951, std: 0.00003, params: {'max_depth': 3, 'min_child_weight': 2},\n",
       "  mean: -0.59779, std: 0.00109, params: {'max_depth': 4, 'min_child_weight': 1},\n",
       "  mean: -0.59825, std: 0.00097, params: {'max_depth': 4, 'min_child_weight': 2}],\n",
       " {'max_depth': 4, 'min_child_weight': 1},\n",
       " -0.59779404712673934)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gsearch2_1.grid_scores_, gsearch2_1.best_params_, gsearch2_1.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([  1680.16610014,   1150.85832536,  22100.999156  ,  42837.74928164]),\n",
       " 'mean_score_time': array([ 25.51095903,  19.16359603,   4.08023334,   4.16873825]),\n",
       " 'mean_test_score': array([-0.59950744, -0.59950651, -0.59779405, -0.59825167]),\n",
       " 'mean_train_score': array([-0.54344381, -0.54479528, -0.49177383, -0.49554712]),\n",
       " 'param_max_depth': masked_array(data = [3 3 4 4],\n",
       "              mask = [False False False False],\n",
       "        fill_value = ?),\n",
       " 'param_min_child_weight': masked_array(data = [1 2 1 2],\n",
       "              mask = [False False False False],\n",
       "        fill_value = ?),\n",
       " 'params': [{'max_depth': 3, 'min_child_weight': 1},\n",
       "  {'max_depth': 3, 'min_child_weight': 2},\n",
       "  {'max_depth': 4, 'min_child_weight': 1},\n",
       "  {'max_depth': 4, 'min_child_weight': 2}],\n",
       " 'rank_test_score': array([4, 3, 1, 2]),\n",
       " 'split0_test_score': array([-0.59933059, -0.59947348, -0.59670666, -0.59728435]),\n",
       " 'split0_train_score': array([-0.54306122, -0.544872  , -0.49185428, -0.49651334]),\n",
       " 'split1_test_score': array([-0.5996843 , -0.59953955, -0.59888152, -0.59921908]),\n",
       " 'split1_train_score': array([-0.54382639, -0.54471857, -0.49169337, -0.49458091]),\n",
       " 'std_fit_time': array([   250.14030731,    251.76089966,  21141.51527667,    291.45167017]),\n",
       " 'std_score_time': array([ 2.94566834,  1.23857105,  0.15200877,  0.03450191]),\n",
       " 'std_test_score': array([  1.76855185e-04,   3.30359764e-05,   1.08742858e-03,\n",
       "          9.67365186e-04]),\n",
       " 'std_train_score': array([  3.82584676e-04,   7.67147035e-05,   8.04558965e-05,\n",
       "          9.66217141e-04])}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gsearch2_1.cv_results_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "保存结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Best: -0.597794 using {'max_depth': 4, 'min_child_weight': 1}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    }
   ],
   "source": [
    "print(\"Best: %f using %s\" % (gsearch2_1.best_score_, gsearch2_1.best_params_))\n",
    "test_means = gsearch2_1.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = gsearch2_1.cv_results_[ 'std_test_score' ]\n",
    "train_means = gsearch2_1.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = gsearch2_1.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "pd.DataFrame(gsearch2_1.cv_results_).to_csv(dpath + 'my_preds_maxdepth_min_child_weights_1.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "展示图片结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ8AAAELCAYAAAAGFYvBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3X18VdWd7/HPlxBBRFF5sCpSGJ8K\nVUSJD63Vig4KamGojoLiCK1lWmWcOreOesfWq9VWOh1qO7W01lp1WpRWRy9aVLAq2voYvEARqlB1\nNGIlgIogRJL87h97hxwOJ+Qk5uyQ8H2/XufF2Wuvvc/aQfNlr73OWooIzMzMstSlvRtgZmY7H4eP\nmZllzuFjZmaZc/iYmVnmHD5mZpY5h4+ZmWXO4WNmZplz+JiZWeYcPmZmlrmu7d2AHVWfPn1i4MCB\n7d0MM7MOY8GCBasjom8xdR0+TRg4cCCVlZXt3Qwzsw5D0v8UW9fdbmZmljmHj5mZZc7hY2ZmmXP4\nmJlZ5hw+ZmaWuZKGj6RRkl6WtELSlQX2T5JULWlh+rooZ980SUvS17k55SdLejEtv0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AAYMGLC9azNr\nWosWMTvFi5i1gffee4+f/OQnrQ6fiRMn7pDh83Hcf//9nHnmmVvCpxjdunXjscceo2fPnmzevJnP\nfe5zjB49muOOO675g1uolOFTBRyQs92fxi4yACJiTc7mz0me0zTsuwG4AUDSTGC5pL7AERHxXFpt\nFvBw3udVSepK0iW3tph25HzmLcAtABUVFQUDymyL/EXMGoKmuUXM+n4Kdt2z/drdCV155ZX85S9/\nYdiwYYwcOZJ+/frxm9/8hpqaGsaNG8e1117Lhg0bOOecc6iqqqKuro5vfvObvPPOO6xcuZIRI0bQ\np08fHn/88YLn79mzJ5dccgmPPvooe+21F9/5znf413/9V9544w1uuukmxowZw+uvv84FF1zAhg3J\njNw//vGP+exnP8t9993HzTffzLx58/jrX//K5z//eZ588kk+8YlPbPM5GzduZPLkySxdupTBgwez\ncWPjLBJz587lmmuuoaamhgMPPJBf/vKX9OzZk4EDB3LuueduafvMmTNZtWoVs2fPZv78+Vx//fXc\ne++9APz2t7/l4osv5r333uMXv/gFJ5xwwlafL4mePZMvDG/evJnNmzeX7FleKcPnBeBgSYNIRrON\nB87LrSBp34hoeII6BliWlpcBe0bEGklDgaHA3LRer3TAwCskgxmWpeWzgQtJ7pLOBh6LiJA0G5iZ\nduHtBxwMPF+SK7bOqfajZM6y/KHM7/1PYx0vYrbFtQ+8xNKV69r0nEP224NrvvDpJvffeOONLFmy\nhIULFzJ37lzuuecenn/+eSKCMWPG8OSTT1JdXc1+++3H7373OwDef/99evXqxfTp03n88cfp06fp\nL9Bu2LCBk046iWnTpjFu3Diuvvpq5s2bx9KlS7nwwgsZM2YM/fr1Y968eXTv3p3ly5czYcIEKisr\nGTduHPfeey8333wzDz/8MNdee23B4AGYMWMGPXr0YPHixSxevJijjjoKgNWrV3P99dfz6KOPsttu\nuzFt2jSmT5/Ot771LQD22GMPnn/+ee68806+/vWv8+CDDzJmzBjOPPNMzj777C3nr62t5fnnn2fO\nnDlce+21PProo6xcuZKLLrqIOXPmAFBXV8fw4cNZ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
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_scores = np.array(test_means).reshape(len(max_depth), len(min_child_weight))\n",
    "train_scores = np.array(train_means).reshape(len(max_depth), len(min_child_weight))\n",
    "\n",
    "for i, value in enumerate(max_depth):\n",
    "    pyplot.plot(min_child_weight, -test_scores[i], label= 'test_max_depth:'   + str(value))\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'max_depth' )                                                                                                      \n",
    "pyplot.ylabel( 'Log Loss' )\n",
    "pyplot.savefig(dpath + 'max_depth_vs_min_child_weght_1.png' )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
